package org.jeecg.modules.golf.tag.listener;

import org.jeecg.modules.golf.tag.event.TagEvent;
import org.jeecg.modules.golf.tag.service.ITagMappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;


/**
 * 标签修改监听器
 */
@Service
public class TagListener implements ApplicationListener<TagEvent> {

    @Autowired
    private ITagMappingService tagMappingService;

    /**
     * Handle an application event.
     *
     * @param event the event to respond to
     */
    @Override
    public void onApplicationEvent(TagEvent event) {
        tagMappingService.saveBatch(event.getTagMappingList(),event.getMainId(),event.getMappingType());

    }
}
